﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition.Hosting;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Easy.Plugin.Managers;

namespace Easy.Plugin
{
    public class PluginRootManagerFactory
    {
        public static PluginRootManager Create()
        {
            var pluginData = new Dictionary<string, object>();

            return
                new DefaultPluginManager(                                       //5. 执行默认插件
                    new ImportServiceLocatorPluginManager(              //4. 导入该容器到 Easy.ServiceLocator 中
                        new ExportServiceLocatorPluginManager(          //3. 导出实现 IServiceLocator 接口的容器
                            new RegisterTypePluginManager(                  //2. 自动注册容器
                                new PluginRootManager(pluginData)))));   //1. 初始化
        }
    }
}
